home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
EDITORS
/
LEDIT
/
!lEdit
/
!Help
< prev
next >
Wrap
Text File
|
1995-04-19
|
31KB
|
965 lines
lEdit Version 0.1 [35]
----------------------
** (c) 1995 Urs Bisang **
** all rights reserved **
This version of lEdit is FREEWARE!
Permission is granted for unrestricted non-commercial use!
If you find this program useful or if you have comments, requests
or bug reports please send a mail to:
bisang@solid.phys.ethz.ch
Purpose: (Lisp) Text Editor
--------
Introduction:
-------------
lEdit is a fully programmable and customizable text editor,
that has special support for Lisp programming. It supports
automatic identing of the source code and the matching of parentheses.
This features can be disabled and then lEdit behaves like a
simple text editor comparable to !Edit. The main difference to other
editors is that lEdit has a builtin Lisp interpreter. Actually lEdit
has been programmed in Lisp itself, so you can customize lEdit in
every way simply by changing the lisp source code and without any
recompilation of the application. In this way lEdit is similar to Emacs
(the famous editor in the Unix world). Of course lEdit is much simpler
and less powerful than Emacs, but it is also much smaller!
Description:
------------
The handling of lEdit is very similar to !Edit. So mainly the
differences to !Edit will be described. For further details on
!Edit see for example the 'RISC OS3 Applications Guide'.
Short description of the menu entries:
Misc
----
Info : tells you about lEdit
New View : opens additional window on the same text
Print : sends the document to the printer
Undo : allows you to step backwards through the most recent changes
you have made to the text
Redo : allows you to remake the changes you reversed with Undo
Save
----
Save: save the file in the current window
Select
------
Save : saves the current text selection
Print : prints the current text selection
Copy : copies current text selection (to the cursor position)
Move : moves current text selection (to the cursor position)
Delete : deletes current text selection
Clear : clears (unselects) current text selection
Edit
----
Find : allows you to search for a string in your file
the find utility is rather simple and no wildcarded
search strings are allowed. but escape characters such
as '\n', '\r', etc and \xhh (hh : hex number)
are allowed to search for non printable characters.
\\ is used for the backslash itself
Goto : allows you to move to a specific line in your file
Replace : allows you to replace a string or all matching strings
through another string in your file. the replace facility
has been separated from the find facility in order to
prevent replacing accidently
Ident : ident line, that contains the cursor according to the rules
of lisp identing
RecIdent : ident lines recursively starting from the line that
contains the cursor
Match () : shows the matching opening parenthesis if the cursor is
right behind a closing parenthesis. if there is no matching
parenthesis or the cursor is not behind a closing
parenthesis nothing happens. in this context parenthesis
means only 'real' parentheses that belong to a lisp
construct (list) and do not stand inside a string,
comment or character constant
Next ( : moves the cursor to the next opening 'real' parenthesis.
Previous ( : moves to previous (matching!) opening 'real' parenthesis
Next ) : moves to next (matching!) closing 'real' parenthesis
Previous ) : moves to previous closing 'real' parenthesis
Options
-------
Ident : enable/disable automatic line identing after typing return
Match : enable/disable automatic highlighting of matching parentheses
after typing a closing parentheses
Amimate : enable/disable animation of cursor on identing
Important keystroke and keystroke equivalents:
Function keys:
--------------
F3 : save file
F4 : find string
F5 : goto line
F6 : replace string
F8 : undo
F9 : redo
Control keys:
-------------
Ctrl-C : copies current text selection (to the cursor position)
Ctrl-V : moves current text selection (to the cursor position)
Ctrl-X : deletes current text selection
Ctrl-Z : clears (unselects) current text selection
Ctrl-R : ident lines recursively
Ctrl-M : show matching 'real' parenthesis
Ctrl-A : moves the cursor to the next opening 'real' parenthesis.
Ctrl-S : moves to previous (matching!) opening 'real' parenthesis
Ctrl-D : moves to next (matching!) closing 'real' parenthesis
Ctrl-F : moves to previous closing 'real' parenthesis
Misc keys:
----------
TAB : ident line, that contains the cursor according to the rules
of lisp identing
SHIFT-TAB : similar to TAB but differing slightly in the rules
for identation (has fixed identation under symbols
as default)
HOME : moves cursor to beginning of the file
DELETE : deletes character to the left of cursor
BACKSPACE : deletes character to the left of cursor
COPY : deletes character to the right of cursor
PAGE-UP : scroll up one window
PAGE-DOWN : scroll down one window
ARROW-UP : moves cursor one line up
ARROW-DOWN : moves cursor one line down
ARROW-LEFT : moves cursor to the left
ARROW-RIGHT : moves cursor to the right
CTRL-ARROW-UP : moves cursor to the beginning of the file
CTRL-ARROW-DOWN : moves cursor to the end of the file
CTRL-ARROW-LEFT : moves the cursor to the first non blank charakter
of the line
CTRL-ARROW-RIGHT: moves cursor to the end of line
Customising lEdit:
------------------
The fonts and the colors used for lEdit can be set using the
environment variable lEdit$Options. The options are the same as
for !Edit (see the 'RISC OS3 Applications Guide'). Apart from
that you can change lEdit in every way (menu layout, keyboard shortcuts,
default settings, new functionality, etc.) by simply patching the
source code, contained in the 'l' directory within the lEdit
application directory. This flexibilty is the main advantage of lEdit
over other editors, due to fact that lEdit is fully programable with its
builtin Lisp interpreter. You could even write a 'completely new editor'
or additional modes with support for other programming languages like
C, C++, Pascal, etc.
There are some special forms like define, defun, lambda, let, etc.,
which have special identation rules. If you have additional forms,
that should be idented in a special way, you can do this by
extending the function 'txt-lisp-ident-hook' located in the file
lispmode. Extensions should be straightforward.
The Lisp Interpreter:
---------------------
The builtin Lisp interpreter is very simple and supports
only two data types: strings and cons cells. Integer and float numbers
are represented as strings, therefore the interpreter is rather slow.
The idea is to use the interpreter as an extension language and
to implement computational intensive task as additional primitives in C.
The naming conventions for the primitives are similar to Scheme.
But it ist not Scheme! The interpreter is dynamically scoped, and
no closures and no continuations are supported. The interpreter is not
tail-recursive! There are additional types like hash tables or opaque
types (menus, text buffers, etc.) which are not first class and 'exist'
only bound to a symbol. If you want to pass an object of such a type to a
function or primitive, you have to pass the symbol which this object
is bound to. If you evaluate a symbol which is bound to an object of
such an non first class type, it evaluates not to its value, but rather to
its own name. I call this form of evaluation 'name evaluation' and
the corresponding non first class types name evaluation types.
The introduction of this rather strange name evaluation is necessary, as
the interpreter supports only strings and cons cells. Functions that
expect name evaluation types first evaluate their argument in a standard
way to obtain the symbol and then access the name evaluation
type object bound to this symbol in a non-standard way. Certain
primitives have Dylan style keyword optional parameters
(for example foo: <expr>). User-defined functions can have only
'normal' optional parameters, which can be declared with the
keyword ':rest' just before the last parameter in the parameter list.
All additional values will then be put in a list and bound to
this last parameter called rest parameter.
Command line options:
---------------------
The interpreter application is called 'wtk' and has the following
command line syntax:
wtk [-options] infile
Options:
-i : starts interactive session reading input from <stdin> and output
going to <stdout>
-verbose : enable verbose mode of the Lisp interpreter
-throwback : uses the DDE throwback mechanism to report errors.
-postmortem : enters the builtin debugger when a fatal error has
occured instead of leaving the interpreter
-args : Command line arguments for the interpreter. The rest of
the command line args are passed to the interpreter in
a list which is bound to the symbol *cmdline-args*
-htsize : set the system hash table size (default: 1800)
-lstsize : set the local parameter stack size (default: 500)
The interpreter uses the path WTK: (set with wtk$path) to find its file
when loading files with the load primitive.
Initialisation of the interpreter and the automatic loading of
additional files on startup is handled with the 'wtk_init', which must
be present, but may be empty.
It is possible to register a finalization procedure, which is
called before the interpreter terminates in a normal way (not
through an error or explicit call to exit).
An expression can be bound to the symbol *finalization* which
gets evaluated right before the interpreter exits.
Brief summary of the builtin primitives:
----------------------------------------
The following notations are used for the summary:
<..> : required expression which evaluates to given type
[..] : optional expression which evaluates to given type
expr : arbitrary lisp expression
char : character constant like #\A, #\\n (newline) etc.
string : "A lisp string"
int : integer number, like 0, -501, #xfff (hex),
#o15 (octal), or char constant #\A, #\\n (newline) etc.
float : floating point number like 1.034, 5.76e-5, etc.
number : float number or integer number
symbol : any valid lisp symbol
hashtable : hash table (opaque type!, name evaluation!)
txt : text edit buffer (opaque type!, name evaluation!)
menu : menu struct (opaque type!, name evaluation!)
dbox : dbox struct (opaque type!, name evaluation!)
expr-sequence : a sequence of valid lisp expressions
;;; kernel primitives
;; loads a lisp source file and evaluates its content.
;; returns file name of loaded file
(load <string>)
;; like load, but a file is only loaded once.
;; returns file name of loaded file or nil if file is already loaded
(use <string>)
;; enters the builtin string and prints and prints optionally
;; a message. returns nil
(debug [string])
;; standard lisp primitive
(quote <expr>)
;; standard lisp primitive
(quasiquote <expr>)
;; exits the interpreter returning optionally an error code
(exit [int])
;; evaluates the expression in the current environment
(eval <expr>)
;; binds a new value to symbol (assignment)
;; returns new value
(set! symbol <expr>)
;; like set! but first argument is also evaluated
(set-eval! <symbol> <expr>)
;; evaluates each expression in the sequence in turn
;; returns the value of the last expression
(begin <expr-sequence>)
;; evaluates the expression sequence as long as condition
;; is true. returns the value of the last expression evaluated
(while <condition-expr> <expr-sequence>)
;; creates and initializes new local symbol for the
;; extent of the let command
;; the semantic of let is similar to the semantic of let*
;; in scheme
(let ((symbol<1> <expr>) ... (symbol<n> <expr>))
<expression-sequence>)
;; prints expressions to stdout
(print <expr-sequence>)
;; defines a new toplevel symbol binding
(define symbol <expr>)
;; defines a new toplevel function
(define (symbol <parameter-list>) <expr-list>)
;; define an anonymous function
(lambda (<parameter-list>) <expr-sequence>)
;; defines a macro. a macro is like a function but gets
;; its arguments unevaluated
(define-syntax symbol (<parameter-list>) <expr-sequence>)
;;; list manipulation primitives
(car <list>) ; car of list
(cdr <list>) ; cdr of list
(cons <expr> <list>) ; cons expr at head of list
;; appends lists together. the last argument can be a
;; list or any valid expression
(append <list> <list> ... <list/expr>)
(list <expr-sequence>) ; build list from expression sequence
;; get the element in a list at position <integer>
(list-ref <list> <integer>)
;; insert element in list after position <integer>
;; destructive operation
(list-insert! <list> <integer> <expr>)
;; returns the length of a list or symbol or string
(length <expr>)
;; standard lisp primitive
(if <cond-expr> <then-expr> [else-expr])
;; standard lisp primitive
;; corresponds to an 'if-then-elsif-else' construct in
;; other procedural languages
(cond (<cond-expr> <expr-sequence>) ....
[(else <expr-sequence>)])
;; logical operators
(not <expr>) ; logical not
(and <expr> ... <expr>) ; logical and
(or <expr> ... <expr>) ; logical or
;; bitwise and operation
(bit-and <integer> ... <integer>)
;; bitwise or operation
(bit-or <integer> ... <integer>)
;; arithmetic operations
(+ <number> ... <number>) ; addition
(* <number> ... <number>) ; multiplication
(- <number> ... <number>) ; subtraction
(/ <number> ... <number>) ; division
(div <number> <number>) ; integer divison
(mod <number> <number>) ; remainder of division
;; numerical comparisons
(= <number> <number>) ; equal
(\= <number> <number>) ; not equal
(> <number> <number>) ; greater
(>= <number> <number>) ; greater equal
(< <number> <number>) ; less
(<= <number> <number>) ; less equal
;; returns #t if the two expressions are equal otherwise #f
(equal? <expr> <expr>)
;; various predicates (return #t or #f)
(symbol? <expr>) ; is it a symbol ?
(string? <expr>) ; is it a string ?
(char? <expr>) ; is it a character constant ?
(list? <expr>) ; is it a list ?
(null? <expr>) ; is it nil (empty list) ?
(integer? <expr>) ; is it an integer number
(float? <expr>) ; is it a float number ?
(number? <expr>) ; is it a number (float/integer) ?
(bound? <expr>) ; is the symbol bound to a value ?
(function? <expr>) ; is it a function
(hashtable? <expr>) ; is it a hashtable
(opaque? <expr>) ; is it an object of opaque type ?
;; transforms string to a symbol
(string->symbol <string>)
;; transforms symbol to a string
(symbol->string <symbol>)
;; gets character at position <integer> in a string
(string-ref <string> <integer>)
;; gets character at position <integer> in a symbol
(symbol-ref <symbol> <integer>)
;; sets the character in string at position <integer> to <char>
(string-set! <string> <integer> <char>)
;; sets the character in symbol at position <integer> to <char>
(symbol-set! <symbol> <integer> <char>)
;; concatenates expressions to a string
(string-concat <expr-sequence>)
;; concatenates expressions to symbol
(symbol-concat <expr-sequence>)
;; gets 'subsymbol' from <integer1> to <integer2>
(subsymbol <symbol> <integer1> <integer2>)
;; gets 'substring' from <integer1> to <integer2>
(substring <symbol> <integer1> <integer2>)
;; transforms character to a symbol
(character->symbol <char>)
;; set property of a symbol
(getp <symbol> <symbol>)
;; get property of a symbol
(setp! <symbol> <symbol> <expr>)
;;; hash table primitives
;; lookup value of <symbol> in hashtable
(hash-ref <hashtable> <symbol>)
;; set value of <sybmol> in hashtable
(hash-set! <hashtable> <symbol> <expr>)
;; create hash table of size <integer> and bind it to symbol
;; (name evaluation type!)
(make-hashtable symbol <integer>)
;;; error messages (supports throwback)
(sfatal <expr> <expr-sequence>) ; fatal error
(serror <expr> <expr-sequence>) ; non fatal error
(swarning <expr> <expr-sequence>) ; warning message
;; wait <float> seconds
(delay <float>)
;; executes external command line command (OSCLI)
(system <expr-sequence>)
;;; additional primitives supporting WIMP programming
;;; most of these primitives are directly from the RISCOS_LIB
;;; of Acorn Desktop C V4. For details about these primitives
;;; see the Acorn Desktop C V4 reference manual.
;; returns version of wtk
(wtk-version)
;; initializes wtk. wimpt_init(<string>), res_init(<string>),
;; respr_init(), template_init() and dbox_init are called
(wtk-init <string>)
;; installs a handler for the dataopen broadcast message
(wtk-dataopen-handler <expr>)
;; installs a handler for the prequit broadcast message
;; handler should return #t or #f
(wtk-prequit-handler <expr>)
(wimpt-init <string>) ; init wimp
(res-init <string>) ; init resources
(resspr-init) ; init sprite resources
(resspr-area) ; return actual sprite area
(template-init) ; init templates
(wimpt-wimpversion <integer>) ; set wimp version
;; display wimp error dialog box
;; <integer> should be 1 (fatal) or 0 (non fatal) error
(werr <integer> <expr-sequence>)
;; set new baricon sprite
(baricon-newsprite <string>)
;; set new baricon menu with a new handler and an optional handle
;; <symbol> is the name of the handler function
(baricon-newmenu <menu> <symbol> [handle])
;; put an icon on the icon bar and set handlers, menus, etc.
(baricon <string>
[:left] ; icon on left side of icon bar
[clickproc: <expr>] ; action for click on baricon
[loadproc: <expr>] ; action for drag on baricon
[text: <string>] ; baricon with text
[spritearea: <integer>] ; spritearea for baricon
[menu: <menu> menuhandler: <expr> menu-handle: <expr>]) ; baricon menu
;; shift pressed?
(akbd-pollsh)
;; ctrl pressed?
(akbd-pollctl)
;; dialog box primitives
(dbox-new <string>) ; create dbox
(dbox-dispose <dbox>) ; destroy dbox
(dbox-show <dbox>) ; display dbox
(dbox-showstatic <dbox>) ; display dbox (static)
(dbox-hide <dbox>) ; close dbox
;; set textfield #<integer> of dbox to value <string>
(dbox-setfield <dbox> <integer> <string>)
;; get value of textfield #<integer1> (buffer size: <integer2>)
(dbox-getfield <dbox> <integer1> <integer2>)
;; set numeric value <integer1> of a dbox field #<integer1>
(dbox-setnumeric <dbox> <integer1> <integer2>)
;; get numeric value of dbox field #<integer>
(dbox-getnumeric <dbox> <integer>)
;; fade dox field #<integer>
(dbox-fadefield <dbox> <integer>)
;; unfade dbox field #<integer>
(dbox-unfadefield <dbox> <integer>)
;; display dbox as long as necessary
(dbox-fillin <dbox>)
;; similar to dbox-fillin
(dbox-fillin-fixedcaret <dbox>)
;; popup dbox with name <string1> and message <string2>
;; and return activated field number
(dbox-popup <string1> <string2>)
;; returns whether dbox should persist
(dbox-persist)
;; return window handle of a dbox
(dbox-syshandle <dbox>)
;; init dboxes
(dbox-init)
;; displays a yes/no dbox with question <string>
(dbox-query <string>)
;; process an event
(event-process)
;; are there any active windows ready for event processing ?
(event-anywindows)
;; attach menu to given window
;; window handle: <integer>, menu handler: <expr1>, menu handle: <expr2>
(event-attachmenu <integer> <menu> <expr1> <expr2>)
;; attach menu maker to given window
;; window handle: <integer>, menu handler: <expr1> menu handle: <expr2>
(event-attachmenumaker <integer> <expr1> <expr2>)
;; clear current menu tree
(event-clear-current-menu)
;; is the menu going to be recreated ?
(event-is-menu-being-recreated)
;; create new menu
;; menu title: <string1>, menu description: <string2>
(menu-new <string1> <string2>)
;; change or extend existing menu
(menu-change <menu>
[extend: <string>] ; extend menu
[submenu: <menu> entry: <integer>] ; attach submenu
;; tick (<integer1>) or fade (<integer2>) menu entry
[setflags: <integer1> <integer2> entry: <integer>]
[make-sprite: <string> entry: <integer>] ; use sprite for menu entry
;; make a menu entry writable (use symbol as buffer, distructiv!)
[make-writeable: <symbol> <string> entry: <integer>])
;; destroys menu (<integer> != 0, recursive dispose of submenus)
(menu-dispose <menu> <integer>)
;; main event loop
(main-event-loop)
;; init flex memory manager
(flex-init)
;;; text buffer primitives
;; create a new text buffer
;; [integer] undo buffer size (=0 no undo buffer)
(txt-new <string> [integer])
;; display text buffer in a window
(txt-show <txt>)
;; close windows open windows of the text buffer
(txt-hide <txt>)
;; set window title of text buffer
(txt-settitle <txt> <string>)
;; deletes a text buffer
(txt-dispose <txt>)
;; internal size of text buffer
(txt-bufsize <txt>)
;; set internal size of text buffer
(txt-setbufsize <txt> <integer>)
;; get the char options of the text buffer
(txt-charoptions <txt>)
;; set the char options of the text buffer
;; mask: <integer1>, flags: <integer2>
(txt-setcharoptions <txt> <integer1> <integer2>)
;; returns position of cursor
(txt-dot <txt>)
;; returns maximum value the cursor can take
(txt-size <txt>)
;; set cursor at position <integer> in text buffer
(txt-setdot <txt> <integer>)
;; move cursor by <integer> chars
(txt-movedot <txt> <integer>)
;; insert char to the right of the cursor
(txt-insertchar <txt> <char>)
;; insert string to the right of the cursor in the text buffer
(txt-insertstring <txt> <string>)
;; delete #<integer> characters to the right of the cursor
(txt-delete <txt> <integer>)
;; get character at cursor position
(txt-charatdot <txt>)
;; get character at position #<integer>
(txt-charat <txt> <integer>)
;; scroll text window in vertical direction
;; by #<integer1> lines (<integer2>: cursor fixed)
(txt-movevertical <txt> <integer1> <integer2>)
;; scroll text window in horizontal direction
;; by #<integer> characters
(txt-movehorizontal <txt> <integer>)
;; return number of visible lines in text window
(txt-visiblelinecount <txt>)
;; return number of visible columns in text window
(txt-visiblecolcount <txt>)
;; text selection primitives
;; returns #t if text is selection is made in the text buffer
;; #f otherwise
(txt-selectset <txt>)
;; returns index of start of current selection
(txt-selectstart <txt>)
;; returns index of end of current selection
(txt-selectend)
;; make a text selection from <integer1> to <integer2>
(txt-setselect <txt> <integer1> <integer2>)
;; returns next event for the text buffer
(txt-get <txt>)
;; number of pending events for the text buffer
(txt-queue <txt>)
;; ungets an event (code: <integer>) for the text buffer
(txt-unget <txt> <integer>)
;; register an event handler (<expr>) for the text buffer
(txt-eventhandler <txt> <expr>)
;; init text edit module
(txt-init)
;; return window handle of text buffer
(txt-syshandle <txt>)
;; set name of environment variable used for text buffer options
(txtopt-set-name <string>)
;; get name of environment variable used for text buffer options
(txtopt-get-name)
;; set a 'global' text selection from <integer1> to <integer2>
(txtscrap-setselect <txt> <integer1> <integer2>)
;; returns text buffer that owns current text selection
(txtscrap-selectowner)
;; creates a new view on the text buffer
(txtwin-new <txt>)
;; number of views on the text buffer
(txtwin-number)
;; closes a view on a text buffer
(txtwin-dispose <txt>)
;; set current view of the text buffer
(txtwin-setcurrentwindow <txt>)
;; start visual delay (hour glass)
(visdelay-begin)
;; set percent completed for hour glass
(visdelay-percent <integer>)
;; beende visual delay (hour glass)
(visdelay-end)
;; init visual delay
(visdelay-init)
;; send unkown key event back to wimp for further actions
(wimp-processkey <integer>)
;; increment active windows counter
(win-activeinc)
;; decrement active windows counter
(win-activedec)
;; returns number of active windows
(win-activeno)
;; give caret away to window on the top of the window stack
(win-give-away-caret)
;; returns name and type of file to import as a list
;; or #f, if it fails
(xferrecv-checkinsert)
;; data (file) import completed
(xferrecv-insertfileok)
;; tests if menu entry <integer> has been selected
;; menu selection 'string': <symbol>
(menu-item <symbol> <integer>)
;; return submenu selection from menu selection
;; menu selection 'string': <symbol>
(menu-subitem <symbol>)
;;; predicates for decoding keyboard events
;;; for textedit windows
(txt-key-char? <integer>) ; ascii char (0-255)
(txt-key-special? <integer>) ; special key, like function keys (265-512)
(txt-key-return? <integer>) ; return key
;; arrow (cursor) key combinations
(txt-key-up? <integer>)
(txt-key-down? <integer>)
(txt-key-left? <integer>)
(txt-key-right? <integer>)
(txt-key-shift-up? <integer>)
(txt-key-shift-down? <integer>)
(txt-key-shift-left? <integer>)
(txt-key-shift-right? <integer>)
(txt-key-ctrl-up? <integer>)
(txt-key-ctrl-down? <integer>)
(txt-key-ctrl-left? <integer>)
(txt-key-ctrl-right? <integer>)
;; function key combinations
;; returns key number (1-12) or #f
(txt-key-functionkey? <integer>)
(txt-key-shift-functionkey? <integer>)
(txt-key-ctrl-functionkey? <integer>)
(txt-key-escape? <integer>) ; escape key
;; tab key combinations
(txt-key-tab? <integer>)
(txt-key-shift-tab? <integer>)
(txt-key-ctrl-tab? <integer>)
;; print key combinations
(txt-key-print? <integer>)
(txt-key-shift-print? <integer>)
(txt-key-ctrl-print? <integer>)
;; insert key combinations
(txt-key-insert? <integer>)
(txt-key-shift-insert? <integer>)
(txt-key-ctrl-insert? <integer>)
(txt-key-delete? <integer>) ; delete key
(txt-key-backspace? <integer>) ; backspace key
;; copy key combinations
(txt-key-copy? <integer>)
(txt-key-shift-copy? <integer>)
(txt-key-ctrl-copy? <integer>)
(txt-key-home? <integer>) ; home key
(txt-key-pageup? <integer>) ; pageup key
(txt-key-pagedown? <integer>) ; pagedown key
;;; mouse events
;; clicked on window close icon
(txt-closeicon? <integer>)
;; events for vertical scroll bar
(txt-scrollarrow-up? <integer>) ; scroll arrow up pressed
(txt-scrollarrow-down? <integer>) ; scroll arrow down pressed
(txt-scrollbar-up? <integer>)
(txt-scrollbar-down? <integer>)
;; mouse events in the text window
;; returns position in text buffer where event occured or #f
(txt-select-clicked? <integer>)
(txt-select-doubleclicked? <integer>)
(txt-adjust-clicked? <integer>)
(txt-adjust-doubleclicked? <integer>)
(txt-select-pressed? <integer>)
(txt-adjust-pressed? <integer>)
(txt-icon-dragged? <integer>) ; icon dragged over window
(txt-mouse-event? <integer>) ; is it a mouse event ?
(txt-mouse-position <integer>) ; returns position of a mouse event
;; insert string to the left of the cursor
(txt-insertstring* <txt> <expr-sequence>)
;; insert char to the left of the cursor
(txt-insertchar* <txt> <char>)
;; delete <integer> characters to the left of the cursor
(txt-delete* <txt> <integer>)
;; return current selection as a string
(txt-getselection <txt>)
;;; primitives for the lisp identation
;; calculate lisp identation level
;; returns identation level
(txt-lisp-calcident <txt>)
;; is char at index <integer> within a lisp comment ?
(txt-lisp-comment? <txt> <integer>)
;; is char a whitespace character ?
(txt-lisp-whitespace? <char>)
;; is char at index <integer> a valid lisp parenthesis
(txt-lisp-paren? <txt> <integer>)
;; is char at index <integer> within a string constant ?
(txt-lisp-string? <txt> <integer>)
;; is char at index within a character constant ?
(txt-lisp-charconst? <txt> <integer>)
;; return index of matching parenthesis or #f
(txt-lisp-matchparen <txt> <integer>)
;; return index of next valid lisp paren or #f
(txt-lisp-nextparen <txt> <:forward/:backward> < #\( / #\) >)
;; insert newline to the left of the cursor
(txt-newline <txt>)
;; insert integer spaces to the left of the cursor
(txt-insertspaces <txt> <integer>)
;; calculate identation level of current line
(txt-identlevel <txt>)
;; is line an empty line ?
(txt-emptyline? <txt> [integer])
;; return line number of current line
(txt-linenumber <txt> [integer])
;; return index of end of line
(txt-end-of-line <txt> [integer])
;; return index of beginning of line
(txt-begin-of-line <txt> [integer])
;; search text buffer in forward direction (<bool> case sensitiv)
(txt-findforward <txt> <string> <bool>)
;; search text buffer in backward direction (<bool> case sensitiv)
(txt-findbackward <txt> <string> <bool>)
;; load file with name <string> into text buffer from index <integer> on
;; [bool] display hourglass during loading
(txt-load <txt> <string> <integer> [bool])
;; save contents of buffer with given filename <string> form
;; index <integer1> to index <integer2>
;; [bool] display hourglass during saving
(txt-save <txt> <string> <integer1> <integer2> [bool])
;; save text buffer with a save box with default name <string> from
;; index <integer1> to index <integer2>
;; [bool] display hourglass during saving
(txt-saveas <txt> <string> <integer1> <integer2> [bool])
;; print text buffer from index <integer1> to index <integer2>
;; to the current printer
;; [bool] displat hourglass during saving
(txt-print <txt> <integer1> <integer2> [bool])
;; undo last action
(txt-undo <txt>)
;; redo last undone action
(txt-redo <txt>)